<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒子阴影</title>

    <style>
        div {
            width: 300px;
            height: 300px;
            background-color: pink;
            margin: 100px auto;
            /* 设置阴影 */
            /* box-shadow: 10px 10px 10px 10px black; */
        }

        /* 当鼠标经过时添加阴影 */
        div:hover {
            box-shadow: 10px 10px 10px -4px rgba(0, 0, 0, .3);
        }

    </style>

</head>
<body>
    
    <img src="盒子阴影.png" alt="">
    <br>

    <div></div>

</body>
</html>